#include "Common.h"
#include <qapplication.h>
#include <QtDebug>

#define ZH_STR(str) (str)
//#define LOG_DEBUG(str, level)                                                                                          \
//    {
//qDebug("");
//}
QStatusBar* Common::m_statusBar = nullptr;

void Common::initStatusBar(QStatusBar* bar) 
{
    m_statusBar = bar;
}

QString Common::panelDir()
{
    return workspaceDir() + "/panels";
}

QString Common::workspaceDir()
{
    return qApp->applicationDirPath() + "/workspace";
}

void Common::logOut(QString _msg, QString _namespace, LogLevel level) 
{
    qDebug()<<QString("[%1] %2").arg(_namespace).arg(_msg);
    if (m_statusBar) { 
        m_statusBar->showMessage(_msg, 0);
    }
}
